﻿<%@ Page Title="" Language="C#" MasterPageFile="~/YiDashuihang_.Master" AutoEventWireup="true" CodeBehind="Ask_Water_add.aspx.cs" Inherits="YiDaShuiHang.Ask_Water_add" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
      <script type="text/javascript">
          $(document).ready(function () {
              $("#select li").on("click", function () {
                  var content = $(this).text();
                  document.getElementById('tu').style.marginTop = '9px';
                  $("#brand").text(content);
                  check_logion("manager_name", "login.html");
              })
              $("#select1 li").on("click", function () {
                  var content = $(this).text();
                  document.getElementById('tu1').style.marginTop = '9px';
                  $("#area").text(content);

              })
          })
          function Submit() {


              var send_amount = $.trim($("#send_amount").val());
              var building = $.trim($("#building").val());
              var dorm = $.trim($("#dorm").val());
              if (isUndefinedNullOrEmpty(building)) {
                  layer_alert_error("楼号不能为空！");
                  return false;
              }
              else if (isUndefinedNullOrEmpty(dorm)) {
                  layer_alert_error("宿舍号不能为空！");
                  return false;
              }
              else if (isUndefinedNullOrEmpty(send_amount)) {
                  layer_alert_error("叫水桶数不能为空！");
                  return false;
              }
              var remark = $.trim($("#remark").val());
              var value = send_amount + "|" + building + "|" + dorm + "|" + remark;
              poststr = "{\"type\":\"addrecord\",\"value\":\"" + value + "\"}";
              mj_js_ajax("json", poststr, state);
          }
          function state(data) {
              if (data.result == "ok") {
                  layer_alert(data.msg);

              }
              else if (data.result == "null") {
                  layer_alert_error(data.msg);
              }
              else if (data.result == "short") {
                  layer_alert_error(data.msg);

              }
              else { }

          }
    </script>
    <style type="text/css">
        li {
       cursor:pointer;
            
             }

    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="container">
        <div class="content" style=" width:98%; height:auto; margin:0 auto; ">
        <div class="header">
            <h1 class="page-title">
                添加叫水记录</h1>
        </div>
        <div class="main-content">
            <div class="row">
                <div class="col-md-4">
                   
                    <div class="form-group">
                        <label>
                            楼号</label><input type="text" class="form-control" id="building"></div>
                    <div class="form-group">
                        <label>
                            宿舍号</label><input type="text" class="form-control" id="dorm"></div>
                     <div class="form-group">
                        <label>
                            叫水桶数</label><input type="text" class="form-control" id="send_amount"></div>
                </div>
                <div class="col-md-4">
                    <div class="form-group">
                        <label>
                            备注</label><textarea class="form-control" rows="10" id="remark"></textarea></div>
                </div>
            </div>
            <div class="btn-toolbar list-toolbar">
                <input class="btn btn-info" type="button" value="添加" style=" width:185px" id="add" onclick="Submit()">
                   </div>
            <div id="tips">
            </div>
            <footer><hr><p>© 2015 <a href="#">shuihang</a></p></footer>
        </div>
    </div></div>
</asp:Content>
